<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <title>订单列表</title>
    <link rel="stylesheet" href="../../dist/css/bootstrap.min.css">
    <link rel="stylesheet" href="../../css/base.css">
    <link rel="stylesheet" href="../../css/evaluate.css">
    <link rel="stylesheet" href="../../css/jquery.pagination.css">
    <script src="../../js/jquery.min.js"></script>
    <script src="../../dist/js/bootstrap.js"></script>
</head>
<body>
<div class="container-fluid">
    <div class="solid-hr row">
        <i></i>评价列表
    </div>
    <div class="evaluate-content">

        <table id="tb" th:each="p : ${paginationOne.list}" class="table">
            <tr>
                <td><img src="../../images/evaluate01.jpg" alt=""></td>
                <td>
                    <span th:text="${p.title}">为什么要多吃葡萄干及不同颜色葡萄干的作用</span><br/>
                    <span>用户名：</span><span th:text="${p.username}">用户名</span>&nbsp;&nbsp;&nbsp;<span th:text="${p.date}">2018-07-17 12:30:30</span>&nbsp;&nbsp;&nbsp;<span th:text="${p.status}">好评</span>
                </td>
            </tr>
        </table>
    </div>
    <!--分页-->
    <div class="page-right">
        <div id="pagination3" class="page fl"></div>
    </div>
    <span th:text="${paginationOne.totalPage}"style="display: none"id="totalPage"></span>

</div>
</body>
<script src="../../js/jquery.pagination.min.js"></script>
<script>
    var totalPage = $("#totalPage").text();
    $("#pagination3").pagination({
        totalPage: totalPage,
        isShow: true,
        count: totalPage,
        homePageText: "首页",
        endPageText: "尾页",
        prevPageText: "上一页",
        nextPageText: "下一页",
        callback: function(current){
            var Pagination  ={
                currentPage : current-1,
                size : 10,
            }
            if(current<= totalPage){
                var html ='';
                $.ajax({
                    url:"/system/evaluate",
                    contentType:"application/json; charset=utf-8",
                    type:"post",
                    data : JSON.stringify(Pagination),
                    success:function(data){
                        $(".old").css("display","none");
                        $.each(data.list,function (n,val) {
                            html += " <tr>" +
                                " <td><img src='../../images/evaluate01.jpg' alt=''></td>"+
                                "<td><span>"+val.title+"</span><br/>"+
                                "<span>用户名：</span><span>"+val.username+"</span>&nbsp;&nbsp;&nbsp;<span>"+formatDate(new Date(val.date))+"</span>&nbsp;&nbsp;&nbsp;<span>"+val.status+"</span>"
                                "</td>"+
                                "</tr>"
                        })
                        $("#tb").html(html);

                    },

                });
            }
        }
    })
    function formatDate(now) {
        var year = now.getFullYear();
        var month = now.getMonth() + 1;
        var date = now.getDate();
        var hour = now.getHours();
        var minute = now.getMinutes();
        var second = now.getSeconds();
        if (month < 10) {
            month = "0" + month;
        }
        if (date < 10) {
            date = "0" + date;
        }
        if (minute < 10) {
            minute = "0" + minute;
        }
        if (hour < 10) {
            hour = "0" + hour;
        }
        if (second < 10) {
            second = "0" + second;
        }
        return year + "-" +month +"-"+date +" "+hour + ":" + minute + ":" + second;
    }
</script>
</html>